<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>三角制作</title>
    <style>
        .box1 {
            width: 0;
            height: 0;
            /* border: 100px solid pink; */
            border-top: 100px solid #e50909;
            border-bottom: 100px solid #41e628;
            border-left: 100px solid #d0d01b;
            border-right: 100px solid #091fe5;
            float: left;
        }

        .box2 {
            width: 0;
            height: 0;
            margin-left: 50px;
            /* 若想要一个三角形，其余三个边的 颜色 指定为 透明色 */
            border-left: 100px solid #34f5ff;
            border-top: 100px solid transparent;
            border-bottom: 100px solid transparent;
            border-right: 100px solid transparent;
            float: left;
        }

        .jd {
            position: relative;
            width: 120px;
            height: 249px;
            background-color: pink;
            margin: auto;
        }

        .jd span {
            position: absolute;
            right: 15px;

            margin-top: -18px;
            top: 0;
            width: 0;
            height: 0;
            line-height: 0;
            font-size: 0;
            border-bottom: 10px solid pink;
            border-top: 10Px solid transparent;
            border-left: 10Px solid transparent;
            border-right: 10Px solid transparent;
        }

        .lx {
            position: relative;
            width: 200px;
            height: 200px;
            margin-left: 200px;
            margin-top: 50px;
            background-color: skyblue;
        }

        .lx span {
            position: absolute;
            width: 0;
            height: 0;
            top: 48px;
            right: 0;
            margin-right: -28px;
            line-height: 0;
            font-size: 0;
            border: 15px solid transparent;
            border-left-color: #00e5ff;
        }
    </style>
</head>

<body>
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="jd">
        <span></span>
    </div>
    <div class="lx">
        <span></span>
    </div>
</body>

</html>